package com.lagou.service.impl;

import com.lagou.dao.PersonnelDao;
import com.lagou.domain.Personnel;
import com.lagou.service.PersonnelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional //表示对于当前类中的所有方法进行了事务控制
public class PersonnelServiceImpl implements PersonnelService {

    @Autowired
    private PersonnelDao personnelDao;

    @Override
    public List<Personnel> findAll() {
        return personnelDao.findAll();
    }

    @Override
    public void save(Personnel personnel) {

        personnelDao.save(personnel);
    }
}
